﻿<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" autoFlush="true"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="/WEB-INF/qautil.tld" prefix="qautil"%>
<jsp:include page="viewmyinfo.jsp"/>
<br>
<table align="center" width="100%" cellpadding="0" cellspacing="0" border="0">
    <tr>
        <td>   
            <span class="title">
            	<html:link page="/user.mrqa?action=myquestions">
            		我的帖子
            	</html:link>
            </span>
            <span class="title1">
            	<html:link page="/user.mrqa?action=myanswers">
            		我的回复
            	</html:link>
            </span>
            <span class="title">
            	<html:link page="/user.mrqa?action=viewmysharedfiles">
            		共享资料
            	</html:link>
            </span>
            <span class="title">
            	<html:link page="/user.mrqa?action=mylinks">
            		我的收藏
            	</html:link>
            </span>
            <span class="title">
            	<html:link page="/user.mrqa?action=myspend">
            		积分兑换
            	</html:link>
            </span>
            <span class="title">
            	<html:link page="/user.mrqa?action=myaward">
            		积分奖励
            	</html:link>
            </span>
        </td>
        <td align="right">回复总数:<b><c:out value="${resultSize}"/></b>&nbsp;&nbsp;</td>
    </tr>
</table>    
<table align="center" class="qlist" width="100%" cellpadding="0" cellspacing="0">
    <thead>
    <tr>
        <th>所属帖子</th>
        <th>回复摘要</th>
        <th>日期</th>
        <c:if test="${user_session.type == '1'}">
        <th>操作</th>
        </c:if>
    </tr>
    </thead>
    <tbody>
    <c:forEach  var="answer" items="${myanswers}" varStatus="index">
    <c:if test="${(index.count)%2 == 0}">
      <tr class="even">    
    </c:if>
    <c:if test="${(index.count)%2 != 0}">
      <tr class="odd">    
    </c:if>
        <td>
            <c:set var="questionid" value="${answer.mrIaskQuestion.id}"/>
            	<c:if test="${answer.mrIaskQuestion.mrIaskCategory.type==0}">
            		<html:link page="/question.mrqa?action=view" paramId="id" paramName="questionid">
            			<c:if test="${answer.mrIaskQuestion.titleAttribute != null}">
            				<span style="<c:out value="${answer.mrIaskQuestion.titleAttribute}" />">
            			</c:if>
            			<c:out value="${answer.mrIaskQuestion.title}" escapeXml="false"/>
            			<c:if test="${answer.mrIaskQuestion.titleAttribute != null}">
            				</span>
            			</c:if>
            		</html:link>
            	</c:if>
            	<c:if test="${answer.mrIaskQuestion.mrIaskCategory.type==1}">
            		<html:link page="/life.mrqa?action=view" paramId="id" paramName="questionid">
            			<c:if test="${answer.mrIaskQuestion.titleAttribute != null}">
            				<span style="<c:out value="${answer.mrIaskQuestion.titleAttribute}" />">
            			</c:if>
            			<c:out value="${answer.mrIaskQuestion.title}" escapeXml="false"/>
            			<c:if test="${answer.mrIaskQuestion.titleAttribute != null}">
            				</span>
            			</c:if>
            		</html:link>
            	</c:if>
            	<c:if test="${answer.mrIaskQuestion.mrIaskCategory.type==2}">
            		<html:link page="/tech.mrqa?action=view" paramId="id" paramName="questionid">
            			<c:if test="${answer.mrIaskQuestion.titleAttribute != null}">
            				<span style="<c:out value="${answer.mrIaskQuestion.titleAttribute}" />">
            			</c:if>
            			<c:out value="${answer.mrIaskQuestion.title}" escapeXml="false"/>
            			<c:if test="${answer.mrIaskQuestion.titleAttribute != null}">
            				</span>
            			</c:if>
            		</html:link>
            	</c:if>
        </td>
        <td>
            <span title="<c:out value="${answer.content}"/>"><c:out value="${fn:substring(answer.content,0,20)}"/>.....</span>
        </td>
        <td>
            <fmt:formatDate value="${answer.postDate}" var="postDatexx" type="both" pattern="yyyy-MM-dd HH:mm:ss"/><c:out value="${postDatexx}"/>
        </td>
        <c:if test="${user_session.type == '1'}">
        <td>
            <html:link page="/answer.mrqa?action=idelete" paramId="id" paramName="answer" paramProperty="id">
                删除
            </html:link>
        </td>
        </c:if>        
    </tr>
    </c:forEach>
    </tbody>
</table>
<qautil:page action="/user.mrqa"/>